home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / COS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  451 b   |  16 lines

  1. /* cos.c FUNCTION, FROM P. 206 OF TURBO C BIBLE */
  2. #include<math.h>
  3. #include<stdio.h>
  4. #include<stdlib.h>            /* errno is defined here */
  5. #define R_TO_D  57.29578        /* radians to degree */
  6. main()
  7. {
  8.     double angle, result;
  9.     printf("-----------------Table of cosines------------------");
  10.     printf("\t\tcosine\n");
  11.     for(angle = 0.0; angle <= 180.0; angle += 10.0)
  12.     {
  13.         result = cos(angle / R_TO_D);
  14.         printf("f deg.\t%f\n", angle, result);
  15.     }
  16. }